<?php 
	$year = date("Y")+543;
	$month = date("m");
	
	$time = strtotime("2011-05-01 02:03:00");
	
	$time2 = strtotime("03:03:00");
	
	$d = date("H", $time);

	if($d<='5'){
		$ddate = strtotime("-1 day" , $time);
		$day = date("Ymd",  $ddate);
	} else {
		$day = date("Ymd", $time);
	}
	
	echo $day;

?>
